#include<iostream>
#include<functional>
using namespace std;

void f1(void)
{
	cout<< "This is in function f1.\n";
}

class PackedFunc
{
public:
	using FType = function<void(void)>;
	void operator()(void)
	{
        body_();
	}
	void setbody(FType f)
	{
        body_ = f;
	}
private:
    FType body_;
};

int main(void)
{
    PackedFunc p1;
    PackedFunc p2;

    p1.setbody(f1);
    p2.setbody([](void) -> void{
        cout<< "This is in a lambda function.\n";
    });

    p1();
    p2();
}
